#include "login.h"
#include "ui_login.h"
#include"widget.h"
#include<QDebug>
login::login(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::login)
{
    ui->setupUi(this);
}

login::~login()
{
    delete ui;
}

void login::on_pushButton_clicked()
{
    this->setWindowTitle("选择外观");
    int bg=0;
    int bird=0;
    int bar=0;

    if(ui->bg1->isChecked())
    {
        bg=0;
    }
    else if (ui->bg2->isChecked()) {
        bg=1;
    }


    if(ui->color1->isChecked())
    {
        bird=0;
    }
    else if (ui->color2->isChecked()) {
        bird=1;
    }
    else if (ui->color3->isChecked()) {
        bird=2;
    }


    if(ui->bar1->isChecked())
    {
       bar=0;
    }
    else if (ui->bar2->isChecked()) {
       bar=1;
    }

    game=new flappyBird(bg,bird,bar);
    game->show();
    game->setFixedSize(880,680);
    this->hide();
}

void login::on_pushButton_2_clicked()
{
    this->close();
}
